﻿@using AbpZeroTemplate.Authorization
@using AbpZeroTemplate.Web.Areas.AppAreaName.Startup
@model AbpZeroTemplate.Web.Areas.AppAreaName.Models.Languages.LanguagesIndexViewModel
@{
    ViewBag.CurrentPageName = AppAreaNamePageNames.Common.Languages;
}
@section Styles
{
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/Languages/Index.css" asp-append-version="true" />
}
@section Scripts
{
    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/language-list.js" asp-append-version="true"></script>
}

<div class="m-subheader ">
    <div class="row align-items-center">
        <div class="mr-auto col-sm-12 col-md-6">
            <h3 class="m-subheader__title m-subheader__title--separator">
                <span>@L("Languages")</span>
            </h3>
            <span class="m-section__sub">
                @L("LanguagesHeaderInfo")
            </span>
        </div>
        <div class="col-sm-12 col-md-6 text-right">
            @if (IsGranted(AppPermissions.Pages_Administration_Languages_Create))
            {
                <button id="CreateNewLanguageButton" class="btn btn-primary blue"><i class="fa fa-plus"></i> @L("CreateNewLanguage")</button>
            }
        </div>
    </div>
</div>

<div class="m-content">
    <div class="m-portlet m-portlet--mobile">
        <div class="m-portlet__body">
            <div class="row align-items-center">
                <table id="LanguagesTable" class="display table table-striped table-bordered table-hover dt-responsive nowrap">
                    <thead>
                    <tr>
                        <th>@L("Actions")</th>
                        <th>@L("Name")</th>
                        <th>@L("Code")</th>
                        <th>@L("Default")</th>
                        <th>@L("CreationTime")</th>
                        <th>@L("IsEnabled")</th>
                    </tr>
                    </thead>
                </table>
                @if (Model.IsTenantView)
                {
                    <p class="margin-top-20">
                        @("* " + L("CanNotEditOrDeleteDefaultLanguages"))
                    </p>
                }
            </div>
        </div>
    </div>
</div>